28. Quiz: Tuples

Tuples

QUIZ QUESTION: :

Match the following qualities to their data structure.

ANSWER CHOICES:



Data Structure

Quality

mutable

immutable

ordered

ordered

immutable

unordered

SOLUTION:

Data Structure

Quality

mutable

immutable

ordered

ordered

ordered

ordered

immutable

Tuples

What would the output of the following code be? (Treat the comma in the multiple choice answers as newlines.)

tuple_a = 1, 2
tuple_b = (1, 2)

print(tuple_a == tuple_b)
print(tuple_a[1])
SOLUTION: True, 2

Tuples Playground

Start Quiz:

## You may test any code out here. Use Test Run to see your output